Skip to content

feat(http-client-python): export TypedDicts from namespace-root __init__.py#11194

Closed
l0lawrence wants to merge 1 commit into
microsoft:mainfrom
l0lawrence:l0lawrence-bookish-invention
Closed

feat(http-client-python): export TypedDicts from namespace-root __init__.py#11194
l0lawrence wants to merge 1 commit into
microsoft:mainfrom
l0lawrence:l0lawrence-bookish-invention

Conversation

@l0lawrence

@l0lawrence l0lawrence commented Jul 7, 2026

Copy link
Copy Markdown
Member

Problem

In dpg and typeddict models modes, generated TypedDicts (and their Union/Literal aliases) are written to types.py, but they were never re-exported from the namespace-root __init__.py — only clients and __version__ were. As a result, from <package> import MyModel did not work; the TypedDicts were only reachable via the implicit types submodule (from <package> import types; types.MyModel).

…t__.py

In dpg and typeddict models modes, generated TypedDicts (and their Union/Literal aliases) live in types.py but were never re-exported from the namespace-root __init__.py. Import them from .types and add to __all__ so they can be imported directly from the package.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@microsoft-github-policy-service microsoft-github-policy-service Bot added the emitter:client:python Issue for the Python client emitter: @typespec/http-client-python label Jul 7, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jul 7, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/http-client-python@11194

commit: a585001

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • @typespec/http-client-python
Show changes

@typespec/http-client-python - feature ✏️

Export generated TypedDict types (and their Union/Literal aliases from types.py) from the namespace-root __init__.py in dpg and typeddict models modes, so they can be imported directly from the package:,> ,> python,> from my_package import MyModel # previously only reachable via `from my_package import types`,>

@azure-sdk-automation

Copy link
Copy Markdown

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@l0lawrence l0lawrence closed this Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:python Issue for the Python client emitter: @typespec/http-client-python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant